package com.william.lifetraxer.util;

import static com.william.lifetraxer.util.DbManager.*;

import java.util.List;

public class PointDAO 
{
	public static int insert(Point point)
	{
		String insertString = "insert into " + dbTrackTable + " (userid,longitude,latitude) value(?,?,?)";
		return insertPoint(insertString,point);
	}
	
	public static int delete(int groupid)
	{
		String deleteString = "delete from " + dbTrackTable + " where groupid = ? ";
		return deletePoints(deleteString,groupid);
	}
	
	public static List<Point> get(int groupid)
	{
		String queryString = "select longitude,latitude from " + dbTrackTable + " where groupid = ? ";
		return getPoints(queryString , groupid);
	}
	
	public static void main(String[] args)
	{
		insert(new Point("william",102.110032,101.323523,1));
	}
}
